/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.util.ArrayList;

/**
 *
 * @author 0213101
 */
public class Main {
    
    public static void main(String[] args)
    {
        Hibernate h = new Hibernate();
        Anuncio a = new Anuncio();        
        ArrayList<Curso> al = new ArrayList();
        Curso c = new Curso();
        Curso c1 = new Curso();
        Beneficio b = new Beneficio();
        b.setNome("mamammmamamma");
        ArrayList<Anuncio> an = new ArrayList();
        an.add(a);
        b.setAnuncio(an);
        c.setNome("Agronomia");
        
        c1.setNome("Apicultura");
        al.add(c);
        al.add(c1);
        a.setCurso(al);
        
        h.beginTransaction();
        {
            h.saveOnly(b);
            h.saveOnly(c);
            h.saveOnly(c1);
            h.saveOnly(a);
        }
        h.endTransaction();
        
        
        
        
        
    }

    
}
